# define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int DigitSum(int n, int sum)
{
	sum += n % 10;
	if (n > 9)
	{
		sum = DigitSum(n / 10, sum);
	}
	return sum;
}
int main()
{
	int n = 0, sum = 0;
	scanf("%d", &n);
	printf("%d\n", DigitSum(n, sum));
	return 0;
}